package shell.view.components;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
/**@author Rafael Rocha*/
public class MyTableLabel extends JLabel{
	private static final long serialVersionUID = 1L;
	private boolean mouseOver;
	private ImageIcon normal;
	private ImageIcon over;
	
	public MyTableLabel(String normalPath, String overPath) {
		normal = new ImageIcon(normalPath);
		over = new ImageIcon(overPath);
	}
	
	public MyTableLabel(String label) {
		super(label);
	}
	
	public void setMouseOver(boolean mouseOver) {
		this.mouseOver = mouseOver;
		
	}
	public boolean isMouseOver() {
		return mouseOver;
	}
	public void update() {
		if(isMouseOver()){
			setIcon(over);
			revalidate();
			repaint();
		}else {
			setIcon(normal);
			revalidate();
			repaint();
		}
	}
}
